<?php


declare(strict_types=1);

/**
 * WxvisitController.php
 * 微信小程序访问统计
 * User：Abell
 * Date：2020/4/17
 * Time：14:00
 */

namespace App\Controller\Admin;

use App\Controller\AbstractController;
use Hyperf\HttpServer\Contract\RequestInterface;
use App\Service\WxvisitService;
use Hyperf\Di\Annotation\Inject;

class WxvisitController extends AbstractController
{
    /**
     * @Inject
     * @var WxvisitService
     */
    protected $service;

    /** 关键数据趋势API
     * @Author abell
     * @DateTime 2020-06-2
     * @return object
     */
    public function coreData(RequestInterface $request){
        return $this->jsonApi($this->service->coreData($request->all()));
    }

    /** 获取基本的访问数据 微信服务器数据
     * @Author abell
     * @DateTime 2020-05-27
     * @return object
     */
    public function visitBase(RequestInterface $request){
        return $this->jsonApi($this->service->visitBase($request->all()));
    }

    /** 获取基本的访问数据 服务器数据,旧接口
     * @Author abell
     * @DateTime 2020-05-27
     * @return object
     */
    public function visitHistory(RequestInterface $request){
        return  $this->jsonApi($this->service->visitHistory($request->all()));
    }

    /** 生成按天统计子页面的访问数据
     * @Author abell
     * @DateTime 2020-05-27
     * @return object
     */
    public function websData(RequestInterface $request){
        return $this->jsonApi($this->service->websData($request->all()));
    }

    /** 获取基本的访问数据 服务器数据,旧接口
     * @Author abell
     * @DateTime 2020-05-27
     * @return object
     */
    public function wxDataShow(){
        return $this->jsonApi($this->service->wxDataShow());
    }
}